package com.lock.redis.lockredis.service.impl;

import com.lock.redis.lockredis.bean.Product;
import com.lock.redis.lockredis.repository.ProductRepository;
import com.lock.redis.lockredis.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductRepository repository;


    @Override
    public boolean saveProduct(Product product) {
        repository.save(product);
        return true;
    }

    @Override
    public Product getProductById(Integer productId) {
        return repository.getOne(productId);
    }
}
